package com.hxh.component;

import com.hxh.model.Student;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * @author 兴趣使然黄小黄
 * @version 1.0
 * @date 2023/7/2 0:21
 */
@Component
public class StudentBean {

    @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
    @Bean
    public Student student() {
        Student student = new Student();
        student.setName("黄小黄");
        student.setAge(17);
        student.setGender("男");
        return student;
    }
}
